package com;

import lombok.Data;

import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;

/**
 * @author xiang
 * @create 2021/6/24 17:09
 */
@Data
public class TreeModel {
    private Integer id;
    private String label;
    private Set<TreeModel> children = new HashSet<>();


    //按id判断重复，不用细看
    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TreeModel treeModel = (TreeModel) o;
        return id.equals(treeModel.id);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id);
    }
}
